package com.awn.weidian.demo.controller;


import com.awn.weidian.demo.mapper.IStudent;
import com.awn.weidian.demo.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/demo/student")
public class StudentController {

    /**
     *
     */
    @Autowired
    private IStudent istu;

    @GetMapping("/stulist")
    public List<Student> showStu(){
        return istu.showStudent();
    }

    @PostMapping("/findone")
    public List<Student> findone(@RequestBody Map<String,Object> map){
        return istu.findone(map.get("keyword") == null ?"":map.get("keyword").toString());
    }

}
